import React, { Component, createContext } from 'react'
import { Consumer } from '../utils/context'

// const { Provider, Consumer } = createContext()

class Son extends Component {
    render() {
        return (
            <div className="son">
                {/* 使用Provider传递过来的数据 */}
                {/* Consumer 需要写一个函数 */}
                <Consumer>
                    {
                        (data) => {
                            return 'Son---' + data 
                        }
                    }
                </Consumer>
            </div>
        )
    }
}

export default Son